using System;
using System.Collections.Generic;
using System.Linq;
using ProjectEuler.Core.Helpers;

namespace ProjectEuler.Core
{
    public class Problem10 : IProjectEulerProblem
    {
        private IEnumerable<long> AllPrimesBelow(int n)
        {
            for(long i =0;i<n;i++)
            {
                if(MathHelper.IsPrime(i))
                {
                    yield return i;
                }
            }
        }

        public int Number
        {
            get { return 10; }
        }

        public string Description
        {
            get { return "Find the sum of all the primes below two million."; }
        }

        public string Answer
        {
            get { return AllPrimesBelow(2000000).Sum().ToString(); }
        }
    }
}